<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<!-- remove old header -->


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>cogen API Reference Documentation
        - Class: ReadLine</title><meta name="MSSmartTagsPreventParsing" content="true" /><meta http-equiv="imagetoolbar" content="no" /><link href="css/default.css" rel="stylesheet" type="text/css" /><link href="css/pygments.css" rel="stylesheet" type="text/css" />
    <!-- <link rel="shortcut icon" href="/images/favicon.ico" type="image/vnd.microsoft.icon"/> -->
    <link rel="stylesheet" href="css/apydia.css" type="text/css" />
    <script src="js/jquery-1.2.1.pack.js" type="text/javascript"></script>
    <script src="js/apydia.js" type="text/javascript"></script>
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
</head>
<body>
    <div id="page">
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li>
                        <a href="cogen.html">cogen</a>
                    </li><li>
                        <a href="cogen.common.html">cogen.common</a>
                    </li><li>
                        <a href="cogen.core.html">cogen.core</a>
                    </li><li>
                        <a href="cogen.core.coroutines.html">cogen.core.coroutines</a>
                    </li><li>
                        <a href="cogen.core.events.html">cogen.core.events</a>
                    </li><li>
                        <a href="cogen.core.pubsub.html">cogen.core.pubsub</a>
                    </li><li>
                        <a href="cogen.core.queue.html">cogen.core.queue</a>
                    </li><li>
                        <a href="cogen.core.reactors.html">cogen.core.reactors</a>
                    </li><li>
                        <a href="cogen.core.reactors.base.html">cogen.core.reactors.base</a>
                    </li><li>
                        <a href="cogen.core.reactors.iocp_proactor.html">cogen.core.reactors.iocp_proactor</a>
                    </li><li>
                        <a href="cogen.core.reactors.poll_reactor.html">cogen.core.reactors.poll_reactor</a>
                    </li><li>
                        <a href="cogen.core.reactors.qt_reactor.html">cogen.core.reactors.qt_reactor</a>
                    </li><li>
                        <a href="cogen.core.reactors.select_reactor.html">cogen.core.reactors.select_reactor</a>
                    </li><li>
                        <a href="cogen.core.schedulers.html">cogen.core.schedulers</a>
                    </li><li>
                        <a href="cogen.core.sockets.html">cogen.core.sockets</a>
                    </li><li>
                        <a href="cogen.core.util.html">cogen.core.util</a>
                    </li><li>
                        <a href="cogen.web.html">cogen.web</a>
                    </li><li class="active">
                        <a href="cogen.web.async.html">cogen.web.async</a>
                    </li><li>
                        <a href="cogen.web.wsgi.html">cogen.web.wsgi</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>cogen.web.async</h2>
                <ul>
                    <li>
                        <a href="cogen.web.async.LazyStartResponseMiddleware.html">LazyStartResponseMiddleware</a>
                    </li><li>
                        <a href="cogen.web.async.Read.html">Read</a>
                    </li><li class="active">
                        <a href="cogen.web.async.ReadLine.html">ReadLine</a>
                    </li><li>
                        <a href="cogen.web.async.SynchronousInputMiddleware.html">SynchronousInputMiddleware</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Constructor</h2>
                <ul>
                    <li>
                        <a href="cogen.web.async.ReadLine.html#constructor">__init__</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Methods</h2>
                <ul>
                    <li>
                        <a href="cogen.web.async.ReadLine.html#method-check_overflow">check_overflow</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-cleanup">cleanup</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-finalize">finalize</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-iocp">iocp</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-iocp_done">iocp_done</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-pending">pending</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-process">process</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-run">run</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-set_timeout">set_timeout</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#method-try_run">try_run</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Attributes</h2>
                <ul>
                    <li>
                        <a href="cogen.web.async.ReadLine.html#attribute-addr">addr</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-buff">buff</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-coro">coro</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-delta">delta</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-fileno">fileno</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-iocp_buff">iocp_buff</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-last_checkpoint">last_checkpoint</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-last_update">last_update</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-len">len</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-prio">prio</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-req">req</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-run_first">run_first</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-sock">sock</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-state">state</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-temp_buff">temp_buff</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-timeout">timeout</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-trim">trim</a>
                    </li><li>
                        <a href="cogen.web.async.ReadLine.html#attribute-weak_timeout">weak_timeout</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Class: cogen.web.async.ReadLine</h1>
    <div class="docstring rst"><p>Same a async.Read but doesn't work with chunked input (it would complicate
things too much at the moment).</p>
</div>
    <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/web/async.py#297">View source</a>
    </li>
</ul>
    <div>
        <h2>Constructor</h2>
        <h3 id="constructor">
            __init__
            <span class="args">(self, conn, req, len=4096, **kws)</span>
        </h3>
        <div class="docstring rst"><p>Initial <cite>req</cite> object holds the state of the operations involving
reading the input and it requires to have these attributes:</p>
<ul class="simple">
<li>read_chunked = &lt;bool&gt;</li>
<li>content_length = &lt;int&gt;</li>
<li>read_count = 0</li>
<li>state = async.Read.NEED_SIZE</li>
</ul>
<p>These have to be initialized in the request.</p>
</div>
        <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/web/async.py#303">View source</a>
    </li>
</ul>
    </div>
    <div>
        <h2>Methods</h2>
            <h3 id="method-check_overflow">
                check_overflow
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#561">View source</a>
    </li>
</ul>
            <h3 id="method-cleanup">
                cleanup
                <span class="args">(self, sched, coro)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#266">View source</a>
    </li>
</ul>
            <h3 id="method-finalize">
                finalize
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#522">View source</a>
    </li>
</ul>
            <h3 id="method-iocp">
                iocp
                <span class="args">(self, overlap)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#277">View source</a>
    </li>
</ul>
            <h3 id="method-iocp_done">
                iocp_done
                <span class="args">(self, rc, nbytes)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#283">View source</a>
    </li>
</ul>
            <h3 id="method-pending">
                pending
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#264">View source</a>
    </li>
</ul>
            <h3 id="method-process">
                process
                <span class="args">(self, sched, coro)</span>
            </h3>
            <div class="docstring rst"><p>Add the operation in the reactor if necessary.</p>
</div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#250">View source</a>
    </li>
</ul>
            <h3 id="method-run">
                run
                <span class="args">(self, reactor=True)</span>
            </h3>
            <div class="docstring rst"><p>~ @debug(0)</p>
</div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/web/async.py#323">View source</a>
    </li>
</ul>
            <h3 id="method-set_timeout">
                set_timeout
                <span class="args">(self, val)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/events.py#102">View source</a>
    </li>
</ul>
            <h3 id="method-try_run">
                try_run
                <span class="args">(self, reactor)</span>
            </h3>
            <div class="docstring rst"><p>This method will return a None value or raise a exception if the
operation can't complete at this time.</p>
<p>The socket poller will run this method if the socket is
readable/writeable.</p>
<p>If this returns a value that evaluates to False, the poller will try to
run this at a later time (when the socket is readable/writeable again).</p>
</div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#223">View source</a>
    </li>
</ul>
    </div>
    <div>
        <h2>Attributes</h2>
            <h3 id="attribute-addr">addr</h3>
            <div class="docstring rst"></div>
            <h4>Value of addr</h4>
            <pre class="code"><code>&lt;member 'addr' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-buff">buff</h3>
            <div class="docstring rst"></div>
            <h4>Value of buff</h4>
            <pre class="code"><code>&lt;member 'buff' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-coro">coro</h3>
            <div class="docstring rst"></div>
            <h4>Value of coro</h4>
            <pre class="code"><code>&lt;member 'coro' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-delta">delta</h3>
            <div class="docstring rst"></div>
            <h4>Value of delta</h4>
            <pre class="code"><code>&lt;member 'delta' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-fileno">fileno</h3>
            <div class="docstring rst"></div>
            <h4>Value of fileno</h4>
            <pre class="code"><code>&lt;member 'fileno' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-iocp_buff">iocp_buff</h3>
            <div class="docstring rst"></div>
            <h4>Value of iocp_buff</h4>
            <pre class="code"><code>&lt;member 'iocp_buff' of 'ReadOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-last_checkpoint">last_checkpoint</h3>
            <div class="docstring rst"></div>
            <h4>Value of last_checkpoint</h4>
            <pre class="code"><code>&lt;member 'last_checkpoint' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-last_update">last_update</h3>
            <div class="docstring rst"></div>
            <h4>Value of last_update</h4>
            <pre class="code"><code>&lt;member 'last_update' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-len">len</h3>
            <div class="docstring rst"></div>
            <h4>Value of len</h4>
            <pre class="code"><code>&lt;member 'len' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-prio">prio</h3>
            <div class="docstring rst"></div>
            <h4>Value of prio</h4>
            <pre class="code"><code>&lt;member 'prio' of 'Operation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-req">req</h3>
            <div class="docstring rst"></div>
            <h4>Value of req</h4>
            <pre class="code"><code>&lt;member 'req' of 'ReadLine' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-run_first">run_first</h3>
            <div class="docstring rst"></div>
            <h4>Value of run_first</h4>
            <pre class="code"><code>&lt;member 'run_first' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-sock">sock</h3>
            <div class="docstring rst"></div>
            <h4>Value of sock</h4>
            <pre class="code"><code>&lt;member 'sock' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-state">state</h3>
            <div class="docstring rst"></div>
            <h4>Value of state</h4>
            <pre class="code"><code>&lt;member 'state' of 'Operation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-temp_buff">temp_buff</h3>
            <div class="docstring rst"></div>
            <h4>Value of temp_buff</h4>
            <pre class="code"><code>&lt;member 'temp_buff' of 'ReadOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-timeout">timeout</h3>
            <div class="docstring rst"></div>
            <h4>Value of timeout</h4>
            <pre class="code"><code>&lt;member 'timeout' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-trim">trim</h3>
            <div class="docstring rst"></div>
            <h4>Value of trim</h4>
            <pre class="code"><code>2000</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-weak_timeout">weak_timeout</h3>
            <div class="docstring rst"></div>
            <h4>Value of weak_timeout</h4>
            <pre class="code"><code>&lt;member 'weak_timeout' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.3</a>
        </div>
    </div>
</body>
</html>